package com.qingcloud.adminbackend.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qingcloud.adminbackend.entity.upgrade.CalibrationEquipmentDTO;
import com.qingcloud.adminbackend.entity.upgrade.CalibrationEquipmentDetailDTO;
import com.qingcloud.adminbackend.entity.upgrade.CalibrationEventDTO;
import com.qingcloud.adminbackend.entity.upgrade.CalibrationRequest;
import com.qingcloud.adminbackend.entity.upgrade.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 设备校准
 */
public interface ITdCalibrationMapper {

    /**
     * 分页查询
     *
     * @param calibrationRequest
     * @return
     */
    IPage<CalibrationEventDTO> searchEvent(Page<CalibrationEventDTO> page, @Param("calibrationRequest") CalibrationRequest calibrationRequest);

    List<CalibrationEquipmentDTO> searchEquipmentByEvent(@Param("eventIds") List<Integer> eventIds);

    List<CalibrationEquipmentDetailDTO> searchEquipmentById(@Param("equipmentIds") List<String> equipmentIds);

    Long existEquipment(@Param("equipmentIds") List<String> equipmentIds);

    Long existEvent(@Param("eventIds") List<Integer> eventIds);

    Integer insertEvent(CalibrationEventDTO calibrationEventDTO);

    Integer findMaxEventId();

    Integer insertEquipment(@Param("calibrationEquipmentDTOs") List<CalibrationEquipmentDTO> calibrationEquipmentDTOs);

    void updateEquipmentStatus(@Param("equipmentIds") List<String> equipmentIds, @Param("status") String status);

    void deleteEquipment(@Param("equipmentIds") List<String> equipmentIds);

    void updateEventStatus(@Param("eventIds") List<String> eventIds, @Param("status") String status);
}
